package com.findyou.controller;

import com.findyou.entity.Item;
import com.findyou.service.ItemService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;

import java.util.List;
@Controller
@RequestMapping("/item")
public class ItemConroller {

    @Autowired
    private ItemService itemService;

    /*  商品列表 */
    @RequestMapping("/queryAllItem")
    public String queryAllItem(Model model){

        List<Item> items = itemService.queryItemList();
        model.addAttribute("items", items);
        return "itemList";
    }

}